package io;

import java.io.*;

public class Demo5 {
    public static void main(String[] args) throws IOException {
        /*try (OutputStream outputStream = new FileOutputStream("D:/test.txt", true)) {
            String s = "你好今天";
            outputStream.write(s.getBytes());
        }*/
        try (OutputStream outputStream = new FileOutputStream("D:/test.txt", true)) {
            //这就相当于把字节流转换成字符流了
            PrintWriter writer = new PrintWriter(outputStream);
            writer.println("hello");
            writer.flush();
        }
    }
}
